﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSConsoleTest
{
    struct Point3D
    {
        public int mX;
        public int mY;
        public int mZ;

        public Point3D(int aX, int aY, int aZ)
        {
            this.mX = aX;
            this.mY = aY;
            this.mZ = aZ;
        }

        public override string ToString()
        {
            return "X : " + mX + " Y : " + mY + " Z : " + mZ;
        }
    }

    class TestStructure : BaseConsoleTest
    {
        public void printDescription()
        {
            Console.WriteLine("--- Structure ---");
        }

        public void doTest()
        {
            Point3D valPoint;
            valPoint.mX = 1; valPoint.mY = 1; valPoint.mZ = 1;

            Point3D copiedCalPoint = valPoint;
            copiedCalPoint.mX = 2; copiedCalPoint.mY = 2; copiedCalPoint.mZ = 2;

            Point3D refPoint = new Point3D(100, 100, 100);
            Point3D copiedrefPoint = refPoint;
            copiedrefPoint.mX = 200; copiedrefPoint.mY = 200; copiedrefPoint.mZ = 200;

            Console.WriteLine("struct Point3D : valPoint : {0}", valPoint);
            Console.WriteLine("struct Point3D : copiedCalPoint : {0}", copiedCalPoint);
            Console.WriteLine("struct Point3D : refPoint : {0}", refPoint);
            Console.WriteLine("struct Point3D : copiedrefPoint : {0}", copiedrefPoint);
        }
    }
}
